/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ar.republicagroup.gestion.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author DIEGOALV
 */
@Entity
@Table(name = "cliente_saldo")
@NamedQueries({
    @NamedQuery(name = "ClienteSaldo.findAll", query = "SELECT c FROM ClienteSaldo c")})
public class ClienteSaldo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "saldo_actual")
    private double saldoActual;
    @Basic(optional = false)
    @Column(name = "saldo_anterior")
    private double saldoAnterior;
    @JoinColumn(name="cliente_id",referencedColumnName="id")
    @ManyToOne(optional=false)
    private Cliente clienteId;
    @JoinColumn(name="liquidacion_id",referencedColumnName="id")
    @ManyToOne(optional=false)
    private Liquidacion liquidacionId;
    @Basic(optional = false)
    @Column(name = "estado")
    private int estado;

    public ClienteSaldo() {
    }

    public ClienteSaldo(Integer id) {
        this.id = id;
    }

    public ClienteSaldo(Integer id, double saldoActual, double saldoAnterior, int estado) {
        this.id = id;
        this.saldoActual = saldoActual;
        this.saldoAnterior = saldoAnterior;
        this.estado = estado;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public double getSaldoActual() {
        return saldoActual;
    }

    public void setSaldoActual(double saldoActual) {
        this.saldoActual = saldoActual;
    }

    public double getSaldoAnterior() {
        return saldoAnterior;
    }

    public void setSaldoAnterior(double saldoAnterior) {
        this.saldoAnterior = saldoAnterior;
    }

    public Cliente getClienteId() {
        return clienteId;
    }

    public void setClienteId(Cliente clienteId) {
        this.clienteId = clienteId;
    }

    public Liquidacion getLiquidacionId() {
        return liquidacionId;
    }

    public void setLiquidacionId(Liquidacion liquidacionId) {
        this.liquidacionId = liquidacionId;
    }
    
    
    public int getEstado() {
        return estado;
    }

    public void setEstado(int estado) {
        this.estado = estado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ClienteSaldo)) {
            return false;
        }
        ClienteSaldo other = (ClienteSaldo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return getId().toString();
    }
    
}
